home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2005-11-04 | 52.5 KB | 1,578 lines
function map_enable() { map._visible = true; } function map_disable() { map._visible = false; } function set_lea(lea) { var _loc2_ = lea; var _loc3_ = _g.gLEAArray.toString(); if(_loc3_.indexOf(_loc2_) >= 0) { _g.gLEA = _loc2_; _g.gActiveSearch = "lea"; search_box.gotoAndPlay("lea"); } var _loc1_ = 0; while(_loc1_ < _g.gRegionArray.length) { if(_g.gRegionArray[_loc1_][0] == _loc2_) { _g.gRegion = _loc2_; _g.gActiveSearch = "region"; search_box.gotoAndPlay("region"); } _loc1_ = _loc1_ + 1; } } function get_lea() { return _g.gLEA; } function search_form_init() { var _loc3_ = this; _g.gActiveSearch = ""; if(search_int == undefined) { _g.gKeyListener.onKeyDown = function() { if(Key.getCode() == 13) { if(!_parent.search_in_progress && !_parent.dialogue_box) { if(_g.gActiveSearch == "name") { if(search_int == undefined && _currentframe <= 40) { Key.removeListener(_g.gKeyListener); search_name(); } } else if(_g.gActiveSearch == "postcode") { if(search_int == undefined && _currentframe <= 40) { Key.removeListener(_g.gKeyListener); search_postcode(); } } else if(_g.gActiveSearch == "posttown") { if(search_int == undefined && _currentframe <= 40) { Key.removeListener(_g.gKeyListener); search_posttown(); } } else if(search_int == undefined && _currentframe <= 40) { Key.removeListener(_g.gKeyListener); search_name(); } } } }; Key.addListener(_g.gKeyListener); } school_name.tabIndex = 1; search_box.postcode.tabIndex = 2; search_box.posttown.tabIndex = 2; search_box.postcode.restrict = "A-Z 0-9"; search_box.postcode.onSetFocus = function() { _g.gActiveSearch = "postcode"; Key.addListener(_g.gKeyListener); }; search_box.posttown.restrict = "A-Z \'"; search_box.posttown.onSetFocus = function() { _g.gActiveSearch = "posttown"; Key.addListener(_g.gKeyListener); }; school_name.onSetFocus = function() { _g.gActiveSearch = "name"; Key.addListener(_g.gKeyListener); }; school_name.restrict = "A-Z 0-9 \'"; _global.styles.TextInput.setStyle("borderStyle","none"); _global.styles.TextInput.setStyle("fontFamily","FrnkGothITC Bk BT"); _global.styles.TextInput.setStyle("color","0x3D2F25"); _global.styles.TextInput.setStyle("fontSize","14"); _global.styles.TextInput.setStyle("embedFonts","true"); _global.style.setStyle("themeColor","haloBlue"); search_box.postcode.setStyle("fontSize","15"); var _loc2_ = new Array(5,10,15,20,30,40,50); search_box.searchLimit.removeAll(); var _loc1_ = 0; while(_loc1_ < _loc2_.length) { search_box.searchLimit.addItem(_loc2_[_loc1_]); _loc1_ = _loc1_ + 1; } search_box.searchLimit.setSelectedIndex(1); _loc2_ = new Array("mixed and single sex","mixed","boys","girls"); search_box.gender.removeAll(); _loc1_ = 0; while(_loc1_ < _loc2_.length) { search_box.gender.addItem(_loc2_[_loc1_]); _loc1_ = _loc1_ + 1; } _loc2_ = new Array("all types of","all secondary","all primary","state secondary","state primary","independent secondary","independent preparatory"); search_box.typeOfSchool.removeAll(); _loc1_ = 0; while(_loc1_ < _loc2_.length) { search_box.typeOfSchool.addItem(_loc2_[_loc1_]); _loc1_ = _loc1_ + 1; } if(_g.gLastSearch.postcode.length > 1) { search_box.postcode.text = _g.gLastSearch.postcode; search_box.searchLimit.text = _g.gLastSearch.searchLimit + " nearest schools"; search_box.typeOfSchool.text = _g.gLastSearch.typeOfSchool; if(_g.gLastSearch.typeOfSchool == "all types of") { search_box.typeOfSchool.text += " school"; } search_box.gender.text = _g.gLastSearch.gender; _loc1_ = 0; while(_loc1_ < 10) { if(search_box.searchLimit.getValue() == _g.gLastSearch.searchLimit) { break; } search_box.searchLimit.setSelectedIndex(_loc1_); _loc1_ = _loc1_ + 1; } _loc1_ = 0; while(_loc1_ < 10) { if(search_box.typeOfSchool.getValue() == _g.gLastSearch.typeOfSchool) { break; } search_box.typeOfSchool.setSelectedIndex(_loc1_); _loc1_ = _loc1_ + 1; } _loc1_ = 0; while(_loc1_ < 10) { if(search_box.gender.getValue() == _g.gLastSearch.gender) { break; } search_box.gender.setSelectedIndex(_loc1_); _loc1_ = _loc1_ + 1; } } else if(_g.gLastSearch.name.length > 1) { search_box.name_txt.text = _g.gLastSearch.name; } b_search.onRelease = function() { Key.removeListener(_g.gKeyListener); if(_g.gActiveSearch == "lea") { search_lea(); } else if(_g.gActiveSearch == "region") { _g.gRegion = search_box.region.getValue(); search_region(); } else if(_g.gActiveSearch == "postcode") { search_postcode(); } else if(_g.gActiveSearch == "posttown") { search_posttown(); } else if(search_box.postcode.text.length > 1) { search_postcode(); } else if(school_name.text.length > 1) { search_name(); } }; b_search.onRollOver = function() { this.gotoAndStop(2); }; b_search.onRollOut = b_search.onReleaseOutside = function() { this.gotoAndStop(1); }; search_box.b_modify_search.onRelease = function() { if(_g.gNavActive == "shortlist") { _parent.nav_activate("search",this); } gotoAndPlay(1); }; b_search_name.onRelease = function() { Key.removeListener(_g.gKeyListener); search_name(); }; b_search_name.onRollOver = function() { this.gotoAndStop(2); }; b_search_name.onRollOut = b_search_name.onReleaseOutside = function() { this.gotoAndStop(1); }; b_indi_secondary.onRelease = function() { referrer = "search"; schools_search_preset(this._name); }; b_indi_secondary_11_16.onRelease = function() { referrer = "search"; schools_search_preset(this._name); }; b_indi_prep.onRelease = function() { referrer = "search"; schools_search_preset(this._name); }; b_state_secondary.onRelease = function() { referrer = "search"; schools_search_preset(this._name); }; b_state_secondary_11_16.onRelease = function() { referrer = "search"; schools_search_preset(this._name); }; b_indi_secondary_scottish.onRelease = function() { referrer = "search"; schools_search_preset(this._name); }; b_state_primary.onRelease = function() { referrer = "search"; schools_search_preset(this._name); }; school_name.text = _g.gLastSearch.name.split(",").join(" "); Selection.setFocus("school_name"); } function string_remove_words(str, words) { var _loc1_ = str; _loc1_ = _loc1_.split(" "); var _loc3_ = 0; while(_loc3_ < _loc1_.length) { var _loc2_ = 0; while(_loc2_ < words.length) { if(_loc1_[_loc3_] == words[_loc2_]) { _loc1_.splice(_loc3_,1); } _loc2_ = _loc2_ + 1; } _loc3_ = _loc3_ + 1; } _loc1_ = _loc1_.toString(); _loc3_ = 0; while(_loc3_ < _loc1_.length) { if(_loc1_.charAt(_loc3_) == ",") { _loc1_ = _loc1_.substring(0,_loc3_) + " " + _loc1_.substring(_loc3_ + 1,_loc1_.length); } _loc3_ = _loc3_ + 1; } return _loc1_; } function string_shorten_words(str, len) { var _loc1_ = str; var _loc3_ = len; _loc1_ = _loc1_.split("\'").join("*"); _loc1_ = _loc1_.split(" "); var _loc2_ = 0; while(_loc2_ < _loc1_.length) { if(_loc1_[_loc2_].length > _loc3_) { _loc1_[_loc2_] = _loc1_[_loc2_].slice(0,_loc3_); } _loc2_ = _loc2_ + 1; } _loc1_ = _loc1_.toString(); _loc2_ = 0; while(_loc2_ < _loc1_.length) { if(_loc1_.charAt(_loc2_) == ",") { _loc1_ = _loc1_.substring(0,_loc2_) + " " + _loc1_.substring(_loc2_ + 1,_loc1_.length); } _loc2_ = _loc2_ + 1; } return _loc1_; } function string_replace_words(str, word, newword) { var _loc1_ = str; _loc1_ = _loc1_.split(word).join(newword); return _loc1_; } function string_normalise_results(txt) { var _loc1_ = txt; _loc1_ = _loc1_.toString(); _loc1_.split("%").join(""); if(_loc1_.indexOf(".") != -1) { if(_loc1_.charAt(2) == ".") { _loc1_ = _loc1_.substring(0,4); } else { _loc1_ = _loc1_.substring(0,3); } _loc1_ += "%"; } else if(Math.round(_loc1_) > 0 && _loc1_.length >= 1) { _loc1_ += ".0%"; } else { _loc1_ = "n/a"; } if(_loc1_ == "0.0%" || _loc1_ == "0") { _loc1_ = ""; } return _loc1_; } function ranking_normalise(rnk) { var _loc1_ = rnk; _loc1_ = _loc1_.toString(); var _loc2_ = 0; if(_loc1_.indexOf(".1") > -1) { _loc2_ = _loc2_ + 1; } _loc1_ = Math.floor(_loc1_); if(_loc1_ > 0) { _loc1_ = _loc1_.toString(); if(_loc2_) { _loc1_ += "="; } } else { _loc1_ = _loc1_.toString(); _loc1_ = ""; } return _loc1_; } function string_no_pct(txt) { var _loc1_ = txt; _loc1_ = _loc1_.toString(); _loc1_ = _loc1_.split(".")[0]; _loc1_ = _loc1_.split("%").join(""); if(_loc1_ == "0") { _loc1_ = ""; } return _loc1_; } function currency_format(txt) { var _loc1_ = txt; _loc1_ = _loc1_.toString(); if(_loc1_.length > 3) { _loc1_ = _loc1_.substr(0,_loc1_.length - 3) + "," + _loc1_.substr(_loc1_.length - 3,_loc1_.length); } _loc1_ = "£" + _loc1_; return _loc1_; } function search_postcode() { if(search_box.postcode.text.length <= 1) { Key.removeListener(_g.gKeyListener); _parent.dialogue_add("Postcode too short!","Please enter a valid UK postcode including spaces, i.e. N1 1TY",275); } else { var _loc1_ = new Object(); _loc1_.sortBy = "posx,posy"; _g.gLastSearch.region = ""; _g.gLastSearch.lea = ""; _g.gLastSearch.name = ""; _loc1_.name = ""; schools_search(_loc1_); } } function search_lea() { var _loc3_ = new Object(); var _loc1_ = search_box.typeOfSchool.getValue(); if(_loc1_ == "all secondary") { _loc1_ = "State Secondary\' OR school_type = \'Independent Secondary"; } else if(_loc1_ == "all primary") { _loc1_ = "State Primary\' OR school_type = \'Independent Preparatory and Junior"; } else if(_loc1_ == "state secondary") { _loc1_ = "State Secondary"; } else if(_loc1_ == "state primary") { _loc1_ = "State Primary"; } else if(_loc1_ == "independent secondary") { _loc1_ = "Independent Secondary"; } else if(_loc1_ == "independent preparatory") { _loc1_ = "Independent Preparatory and Junior"; } var _loc2_ = search_box.gender.getValue(); if(_loc2_ == "mixed and single sex") { _loc2_ = "Boys\' OR entry_gender = \'Girls\' OR entry_gender = \'Mixed"; } else if(_loc2_ == "boys") { _loc2_ = "Boys"; } else if(_loc2_ == "girls") { _loc2_ = "Girls"; } else if(_loc2_ == "mixed") { _loc2_ = "Mixed"; } if(_loc1_ == "all types of") { _loc3_.sql = "SELECT school_id,name,school_type,sub_type,st_ranking" + _g.thisYearShort + ",st_ranking" + _g.lastYearShort + ",town,entry_gender,posx,posy,unique_id FROM schools,results WHERE schools.school_id = results.school_id AND (entry_gender = \'" + _loc2_ + "\') AND (lea = \'" + _g.gLEA + "\') ORDER BY school_type"; } else { _loc3_.sql = "SELECT school_id,name,school_type,sub_type,st_ranking" + _g.thisYearShort + ",st_ranking" + _g.lastYearShort + ",town,entry_gender,posx,posy,unique_id FROM schools,results WHERE schools.school_id = results.school_id AND (entry_gender = \'" + _loc2_ + "\') AND (lea = \'" + _g.gLEA + "\') AND (school_type = \'" + _loc1_ + "\') ORDER BY school_type"; } _loc3_.searchLimit = 500; _g.gLastSearch.lea = _g.gLEA; schools_search(_loc3_); } function search_region() { var search = new Object(); var _loc3_ = undefined; var _loc2_ = 0; while(_loc2_ < _g.gRegionArray.length) { if(_g.gRegionArray[_loc2_][0] == _g.gRegion) { var _loc1_ = 1; while(_loc1_ < _g.gRegionArray[_loc2_].length) { _loc3_ += "(lea = \'" + _g.gRegionArray[_loc2_][_loc1_] + "\')"; if(_loc1_ < _g.gRegionArray[_loc2_].length - 1) { _loc3_ += " OR "; } _loc1_ = _loc1_ + 1; } } _loc2_ = _loc2_ + 1; } if(_g.gRegion == "Scotland") { _loc3_ += " OR school_id = \'SIS006\'"; } var typeOfSchool = search_box.typeOfSchool.getValue(); if(typeOfSchool == "all secondary") { typeOfSchool = "State Secondary\' OR school_type = \'Independent Secondary"; } else if(typeOfSchool == "all primary") { typeOfSchool = "State Primary\' OR school_type = \'Independent Preparatory and Junior"; } else if(typeOfSchool == "state secondary") { typeOfSchool = "State Secondary"; } else if(typeOfSchool == "state primary") { typeOfSchool = "State Primary"; } else if(typeOfSchool == "independent secondary") { typeOfSchool = "Independent Secondary"; } else if(typeOfSchool == "independent preparatory") { typeOfSchool = "Independent Preparatory and Junior"; } var gender = search_box.gender.getValue(); if(gender == "mixed and single sex") { gender = "Boys\' OR entry_gender = \'Girls\' OR entry_gender = \'Mixed"; } else if(gender == "boys") { gender = "Boys"; } else if(gender == "girls") { gender = "Girls"; } else if(gender == "mixed") { gender = "Mixed"; } if(typeOfSchool == "all types of") { search.sql = "SELECT school_id,name,school_type,sub_type,st_ranking" + _g.thisYearShort + ",st_ranking" + _g.lastYearShort + ",town,entry_gender,posx,posy,unique_id FROM schools,results WHERE schools.school_id = results.school_id AND (entry_gender = \'" + gender + "\') AND (" + _loc3_ + ") ORDER BY school_type"; } else { search.sql = "SELECT school_id,name,school_type,sub_type,st_ranking" + _g.thisYearShort + ",st_ranking" + _g.lastYearShort + ",town,entry_gender,posx,posy,unique_id FROM schools,results WHERE schools.school_id = results.school_id AND (entry_gender = \'" + gender + "\') AND (" + _loc3_ + ") AND (school_type = \'" + typeOfSchool + "\') ORDER BY school_type"; } search.searchLimit = 500; _g.gLastSearch.region = _g.gRegion; schools_search(search); } function search_name() { _g.gLastSearch.postcode = ""; var search = new Object(); search.postcode = 0; search.typeOfSchool = 0; search.gender = 0; _g.gLastSearch.region = ""; _g.gLastSearch.lea = ""; search.searchLimit = 250; search.sortBy = sortBy; search.sortDir = 0; if(school_name.text.length <= 2) { _parent.dialogue_add("Name too short!","Please search for a minimum of 3 characters",275); } else { var school_name = school_name.text.split("\n").toString(); _g.gLastSearch.name = school_name; school_name = string_remove_words(school_name,["THE","OF","AND","OR","PRIMARY","SECONDARY","JUNIOR","PREPARATORY "]); school_name = string_replace_words(school_name,"SAINT ","ST "); school_name = string_replace_words(school_name,"CHURCH OF ENGLAND","C OF E"); school_name = string_replace_words(school_name,"ROMAN CATHOLIC","RC"); school_name = string_replace_words(school_name,"\'"," "); school_name = string_shorten_words(school_name,6); school_name = school_name.split(" "); var _loc2_ = undefined; var _loc1_ = 0; while(_loc1_ < school_name.length) { var _loc3_ = school_name[_loc1_].toUpperCase(); if(_loc3_ != "MARY") { _loc2_ += "name LIKE \'" + _loc3_ + "\' no_case "; if(_loc1_ < school_name.length - 1) { _loc2_ += " AND "; } } else { _loc2_ += "(name LIKE \' MARY\' no_case OR name LIKE \'\\AMARY\' no_case)"; if(_loc1_ < school_name.length - 1) { _loc2_ += " AND "; } } _loc1_ = _loc1_ + 1; } search.sql = "SELECT school_id,name,school_type,sub_type,st_ranking" + _g.thisYearShort + ",st_ranking" + _g.lastYearShort + ",town,entry_gender,posx,posy,unique_id FROM schools,results WHERE schools.school_id = results.school_id AND " + _loc2_ + " ORDER BY school_type"; search.name = school_name; schools_search(search); } } function search_posttown() { _g.gLastSearch.postcode = ""; var search = new Object(); search.postcode = 0; search.typeOfSchool = 0; search.gender = 0; _g.gLastSearch.region = ""; _g.gLastSearch.lea = ""; search.searchLimit = 250; search.sortBy = sortBy; search.sortDir = 0; if(search_box.posttown.text.length <= 2) { _parent.dialogue_add("Town name too short!","Please search for a minimum of 3 characters",275); } else { var _loc2_ = search_box.posttown.text.split("\n").toString(); _loc2_ = string_remove_words(_loc2_,["THE","OF","AND"]); _loc2_ = string_replace_words(_loc2_,"\'"," "); _loc2_ = string_shorten_words(_loc2_,6); _loc2_ = _loc2_.split(" "); var search_criteria; var _loc1_ = 0; while(_loc1_ < _loc2_.length) { var _loc3_ = _loc2_[_loc1_].toUpperCase(); search_criteria += "posttown LIKE \'" + _loc3_ + "\' no_case"; if(_loc1_ < _loc2_.length - 1) { search_criteria += " AND "; } _loc1_ = _loc1_ + 1; } var typeOfSchool = search_box.typeOfSchool.getValue(); if(typeOfSchool == "all secondary") { typeOfSchool = "State Secondary\' OR school_type = \'Independent Secondary"; } else if(typeOfSchool == "all primary") { typeOfSchool = "State Primary\' OR school_type = \'Independent Preparatory and Junior"; } else if(typeOfSchool == "state secondary") { typeOfSchool = "State Secondary"; } else if(typeOfSchool == "state primary") { typeOfSchool = "State Primary"; } else if(typeOfSchool == "independent secondary") { typeOfSchool = "Independent Secondary"; } else if(typeOfSchool == "independent preparatory") { typeOfSchool = "Independent Preparatory and Junior"; } var gender = search_box.gender.getValue(); if(gender == "mixed and single sex") { gender = "Boys\' OR entry_gender = \'Girls\' OR entry_gender = \'Mixed"; } else if(gender == "boys") { gender = "Boys"; } else if(gender == "girls") { gender = "Girls"; } else if(gender == "mixed") { gender = "Mixed"; } if(typeOfSchool == "all types of") { search.sql = "SELECT school_id,name,school_type,sub_type,st_ranking" + _g.thisYearShort + ",st_ranking" + _g.lastYearShort + ",town,entry_gender,posx,posy,unique_id FROM schools,results WHERE schools.school_id = results.school_id AND (entry_gender = \'" + gender + "\') AND " + search_criteria + " ORDER BY school_type"; } else { search.sql = "SELECT school_id,name,school_type,sub_type,st_ranking" + _g.thisYearShort + ",st_ranking" + _g.lastYearShort + ",town,entry_gender,posx,posy,unique_id FROM schools,results WHERE schools.school_id = results.school_id AND (entry_gender = \'" + gender + "\') AND " + search_criteria + " AND (school_type = \'" + typeOfSchool + "\') ORDER BY school_type"; } search.name = posttown; schools_search(search); } } function schools_search(search, sort) { var _loc1_ = search; trace("~~~~~~~~~~~~~~~~ SEARCH ~~~~~~~~~~~~~~~~~~~"); _g.gGlobalSearch = false; _parent.search_in_progress_view(); oCurrentSearch = _loc1_; if(search_int == undefined) { clearInterval(search_int); Key.removeListener(_g.gKeyListener); school_summary_remove(); if(!sort) { if(!sort.sql) { if(!_loc1_.postcode) { if(search_box.postcode.text.length > 1) { _loc1_.postcode = search_box.postcode.text; } } if(!_loc1_.searchLimit) { _loc1_.searchLimit = search_box.searchLimit.getValue(); } if(!_loc1_.typeOfSchool) { if(search_box.typeOfSchool.getValue().length > 1) { _loc1_.typeOfSchool = search_box.typeOfSchool.getValue(); } } if(!_loc1_.gender) { if(search_box.gender.getValue().length > 1) { _loc1_.gender = search_box.gender.getValue(); } } if(_loc1_.sortBy.length < 1) { _loc1_.sortBy = 0; } if(!_loc1_.title) { _loc1_.title = 0; } } } _loc1_.schoolsArray = new Object(); if(_loc1_.profile != 1) { _g.gLastSearch = _loc1_; _g.gLastSearch.region = _g.gRegion; _g.gLastSearch.lea = _g.gLEA; _g.gLastSearch.sql = _loc1_.sql; } search_int = setInterval(search_delay,750,_loc1_); } } function search_delay(search) { clearInterval(search_int); clearInterval(search_int); clearInterval(search_int); search_int = undefined; _g.gActiveSearch = ""; search_submit(search); } function search_submit(search) { var _loc1_ = search; clearInterval(search_int); getURL("lingo: search_init(\"" + _loc1_.postcode + "\",\"" + _loc1_.posttown + "\",\"" + _loc1_.typeOfSchool + "\",\"" + _loc1_.gender + "\"," + _loc1_.searchLimit + ",\"" + _loc1_.sortBy + "\",\"" + _g.gSort_Ascending + "\",\"" + _loc1_.name + "\",\"" + _loc1_.sql + "\",\"" + _loc1_.id + "\",\"" + _loc1_.profile + "\",\"" + _loc1_.criteria_list + "\")",""); } function schools_search_revise(pos) { _g.gLastSearch.sql = _g.gLastSearch.sql_source; schools_search(_g.gLastSearch); } function school_summary_create(schoolsArray, searchLimit, id, history, profile, name, criteria_list, dest_sql_query, source_sql_query, schoolOfTheYearFound) { _g.gSchool_array = []; schoolsArray = schoolsArray.split("[").join("").split("]").join(""); schoolsArray = schoolsArray.split("::"); var tmpArray = new Array(); var criteria_listArray; if(criteria_list.length > 1) { criteria_listArray = criteria_list.split(","); } else { criteria_listArray = _g.gSearch_Results_Criteria_list; } if(profile != 1) { var _loc2_ = 0; while(_loc2_ <= searchLimit) { school_new_array = schoolsArray[_loc2_].split("|"); if(!school_new_array) { break; } school = new Object(); var _loc3_ = criteria_listArray.length; var _loc1_ = 0; while(_loc1_ < _loc3_) { school[String(criteria_listArray[_loc1_])] = school_new_array[_loc1_]; _loc1_ = _loc1_ + 1; } tmpArray.push(school); _loc2_ = _loc2_ + 1; } } else { trace("profile or league table"); _loc2_ = 0; while(_loc2_ <= searchLimit) { school_new_array = schoolsArray[_loc2_].split("|"); if(!school_new_array) { break; } school = new Object(); _loc3_ = _g.gCriteria_list.length; _loc1_ = 0; while(_loc1_ < _loc3_) { school[String(_g.gCriteria_list[_loc1_][0])] = school_new_array[_loc1_]; _loc1_ = _loc1_ + 1; } tmpArray.push(school); _loc2_ = _loc2_ + 1; } } _g.gSchool_array = tmpArray; school_summary_remove(); _parent.search_in_progress_remove(); if(profile != 1) { _g.gLastSearch.schoolsArray = tmpArray; if(dest_sql_query.length > 0) { _g.gLastSearch.sql = dest_sql_query; } if(source_sql_query.length > 0) { _g.gLastSearch.sql_source = source_sql_query; } school_summary_view(id,0,criteria_listArray,schoolOfTheYearFound); } else { school_view(_g.gSchool_array[0][0]); } } function school_summary_remove() { content.removeMovieClip(); search_results_mask.removeMovieClip(); } function school_summary_sort(sortBy) { if(_g.gSort_Ascending == 1) { _g.gSort_Ascending = 0; } else { _g.gSort_Ascending = 1; } var _loc3_ = undefined; if(_g.gLastSearch.sql.indexOf(" DESC") > 1) { _loc3_ = " ASC"; } else if(_g.gLastSearch.sql.indexOf(" ASC") > 1) { _loc3_ = " DESC"; } else { _loc3_ = " DESC"; } if(sortBy != _g.gLastSearch.sortBy) { _g.gSort_Ascending = 1; _loc3_ = " ASC"; } var _loc2_ = ""; var _loc1_ = 0; while(_loc1_ < _g.gLastSearch.schoolsArray.length) { _loc2_ += "\'" + _g.gLastSearch.schoolsArray[_loc1_].unique_id + "\'"; if(_loc1_ < _g.gLastSearch.schoolsArray.length - 1) { _loc2_ += " OR school_id = "; } _loc1_ = _loc1_ + 1; } var newSQL; newSQL = String(_g.gLastSearch.sql).split("results.school_id AND")[0]; newSQL += " results.school_id AND school_id = " + _loc2_ + " "; var sql = newSQL.split("ORDER BY ")[0]; _g.gLastSearch.sql = sql + "ORDER BY " + sortBy; _g.gLastSearch.sql += _loc3_; _g.gLastSearch.sortBy = sortBy; schools_search(_g.gLastSearch,1); trace("sort here:" + _g.gLastSearch.sql); } function school_summary_view(id, profile, criteria_listArray, schoolOfTheYearFound) { school_info.removeMovieClip(); print_template.removeMovieClip(); trace("school_summary_view"); if(id.length < 10) { if(_g.gNavActive == "shortlist") { gotoAndStop("search_results_shortlist"); play(); } else if(_g.gLastSearch.postcode.length > 1) { gotoAndStop("search_results_postcode"); play(); } else { gotoAndStop("search_results_name"); play(); } } else { gotoAndStop("school_table"); play(); table_id.htmlText = id; } var d = _g.gClipLevel++; createEmptyMovieClip("content",d); y = 135; x = 210; var changeColour = 1; y = scrollbar._y; var i = 0; while(i < _g.gSchool_array.length) { if(oCurrentSearch.templateId != null) { var clip = "table_item" + gClipLevel; x = 30; if(i == 0) { y = 229; } content.attachMovie("template" + oCurrentSearch.templateId,clip,_g.gClipLevel++,{_x:x,_y:y}); } else { var clip = "school_summary" + gClipLevel; content.attachMovie("school_summary",clip,_g.gClipLevel++,{_x:x,_y:y}); } clip = eval("content." + clip); if(changeColour < 0) { clip.bg.gotoAndPlay(2); clip.school_shortlist_indicator.bg.gotoAndPlay(2); } var len = criteria_listArray.length; var j = 0; while(j < len) { clip[criteria_listArray[j]] = _g.gSchool_array[i][criteria_listArray[j]]; j++; } var st_ranking_this_year = _g.gSchool_array[i]["st_ranking" + _g.thisYearShort]; if(schoolOfTheYearFound > 0) { var isSchoolOfYear = 0; var k = 0; while(k < 6) { var school_id = _g.gSchool_array[i].unique_id; if(_g.gSchoolsOfTheYear[k] == school_id && school_id != "") { clip.gotoAndStop(2); schoolOfTheYearFound--; break; } k++; } } if(st_ranking_this_year > 0 && st_ranking_this_year != 999) { clip.times_ranking_txt.text = ranking_normalise(st_ranking_this_year); } else { clip.times_ranking_txt.text = ""; clip.times_ranking_arrow.unloadMovie(); } var st_ranking_last_year = _g.gSchool_array[i]["st_ranking" + _g.lastYearShort]; clip.times_ranking_previous_txt.text = ranking_normalise(st_ranking_last_year); var entrygender = _g.gSchool_array[i].entry_gender; entrygender = entrygender.toLowerCase(); if(entrygender.indexOf("boys") != -1) { clip.gender_indicator.gotoAndPlay("boys"); } else if(entrygender.indexOf("girls") != -1) { clip.gender_indicator.gotoAndPlay("girls"); } else { clip.gender_indicator.gotoAndPlay("mixed"); } var school_type = _g.gSchool_array[i].school_type; var sub_type = _g.gSchool_array[i].sub_type; var num_pupils_6form = Math.round(_g.gSchool_array[i].num_pupils_6form); clip.school_type_icon.gotoAndPlay(school_type); if(sub_type.indexOf("Scottish") > -1) { clip.school_type_icon.txt.text = "SCO"; } else if(sub_type.indexOf("11-16") > -1) { if(num_pupils_6form >= 1 && num_pupils_6form < 10) { clip.school_type_icon.txt.text = "SmS"; } else { clip.school_type_icon.txt.text = "NS"; } } else if(sub_type.indexOf("Small") > -1) { clip.school_type_icon.txt.text = "Sm"; } clip.gcse_a_star_a = string_normalise_results(_g.gSchool_array[i].gcse_a_star_a); clip.a_level_a_b = string_normalise_results(_g.gSchool_array[i].a_level_a_b); clip.a_level_rank = ranking_normalise(_g.gSchool_array[i].a_level_rank); clip.a_level_rank_2003 = ranking_normalise(eval("_g.gSchool_array[i][\'a_level_rank_" + _g.lastYear + "\']")); clip.gcse_rank = ranking_normalise(_g.gSchool_array[i].gcse_rank); clip.gcse_rank_2003 = ranking_normalise(eval("_g.gSchool_array[i][\'gcse_rank_" + _g.lastYear + "\']")); clip.scot_2004_higher_rank = ranking_normalise(_g.gSchool_array[i]["scot_" + _g.thisYear + "_higher_rank"]); clip.scot_2004_standard_int2_rank = ranking_normalise(_g.gSchool_array[i]["scot_" + _g.thisYear + "_standard_int2_rank"]); clip.scotstate_2004_standard_int2_rank = ranking_normalise(_g.gSchool_array[i]["scotstate_" + _g.lastYear + "_standard_int2_rank"]); clip.scotstate_2004_higher_rank = ranking_normalise(_g.gSchool_array[i]["scotstate_" + _g.lastYear + "_higher_rank"]); clip.scot_standard_int2_avg = string_normalise_results(_g.gSchool_array[i].scot_standard_int2_avg); clip.scot_standard_avg = clip.scot_standard_avg.split("%").join(""); clip.scot_standard_avg = _g.gSchool_array[i].scot_standard_avg.split(".")[0]; var pct = _g.gSchool_array[i].scot_standard_avg.split(".")[1].charAt(0); if(pct < 1) { pct = 0; } pct = "." + pct; clip.scot_standard_avg += pct + "%"; clip.scot_higher_avg = clip.scot_higher_avg.split("%").join(""); clip.scot_higher_avg = _g.gSchool_array[i].scot_higher_avg.split(".")[0]; var pct = _g.gSchool_array[i].scot_higher_avg.split(".")[1].charAt(0); if(pct < 1) { pct = 0; } pct = "." + pct; clip.scot_higher_avg += pct + "%"; clip.scot_2004_higher_a_b = string_normalise_results(_g.gSchool_array[i]["scot_" + _g.thisYear + "_higher_a_b"]); clip.scot_2004_higher_standard_2_1a = string_normalise_results(_g.gSchool_array[i]["scot_" + _g.thisYear + "_standard_1_int2_a"]); var sixth_form_2003_avg_points = _g.gSchool_array[i]["sixth_form_" + _g.lastYear + "_avg_points"].split(".")[0]; var pct = _g.gSchool_array[i]["sixth_form_" + _g.lastYear + "_avg_points"].split(".")[1].charAt(0); if(pct < 1) { pct = 0; } pct = "." + pct; sixth_form_2003_avg_points += pct; clip.sixth_form_2004_avg_points = sixth_form_2003_avg_points; var shortlist = _g.gShortlist.schools.toString(); if(_g.gShortlist.schools.length > 0 && _g.gShortlist.schools.toString().indexOf(_g.gSchool_array[i].unique_id) >= 0) { clip.school_shortlist_indicator.gotoAndPlay("active"); } st_rankingThisYear = _g.gSchool_array[i]["st_ranking" + _g.thisYearShort]; st_rankingLastYear = _g.gSchool_array[i]["st_ranking" + _g.lastYearShort]; st_rankingThisYear = Number(st_rankingThisYear); st_rankingLastYear = Number(st_rankingLastYear); if(st_rankingThisYear <= 0) { clip.times_ranking_arrow.unloadMovie(); } else if(st_rankingThisYear > st_rankingLastYear) { if(st_rankingLastYear > 0) { clip.times_ranking_arrow.gotoAndPlay("down"); } else { clip.times_ranking_arrow.unloadMovie(); } } else if(st_rankingThisYear == st_rankingLastYear) { clip.times_ranking_arrow.gotoAndPlay("same"); } else if(st_rankingThisYear < st_rankingLastYear) { clip.times_ranking_arrow.gotoAndPlay("up"); } changeColour *= -1; y += 19; i++; } if(id.length < 10) { attachMovie("search_results_mask","search_results_mask",_g.gClipLevel++,{_x:210,_y:179}); } else if(oCurrentSearch.templateId != null) { attachMovie("search_results_mask","search_results_mask",_g.gClipLevel++,{_x:30,_y:229}); search_results_mask._height = 323; search_results_mask._width = 728; mcTableHeaders.gotoAndStop(oCurrentSearch.templateId + 1); } else { attachMovie("search_results_mask","search_results_mask",_g.gClipLevel++,{_x:210,_y:219}); search_results_mask._height = 323; } content.setMask(search_results_mask); scrollbar_init(content); } function school_get_id(id, pos) { var _loc3_ = 0; var _loc1_ = 0; while(_loc1_ < _g.gLastSearch.schoolsArray.length) { if(_g.gLastSearch.schoolsArray[_loc1_].unique_id == id) { var _loc2_ = _loc1_ + pos; if(_loc2_ < 0) { _loc2_ = _g.gLastSearch.schoolsArray.length - 1; } else if(_loc2_ >= _g.gLastSearch.schoolsArray.length) { _loc2_ = 0; } _loc3_ = _g.gLastSearch.schoolsArray[_loc2_].unique_id; _loc1_ = _g.gLastSearch.schoolsArray.length + 1; } _loc1_ = _loc1_ + 1; } return _loc3_; } function school_get_info(id) { var school_id = 0; info = new Object(); var _loc3_ = 0; while(_loc3_ < _g.gSchool_array.length) { if(_g.gSchool_array[_loc3_].unique_id == id) { school_id = _loc3_; } _loc3_ = _loc3_ + 1; } var len = _g.gCriteria_list.length; var _loc2_ = 0; while(_loc2_ < len) { attrib_len = _g.gCriteria_list[_loc2_].length; var _loc1_ = 0; while(_loc1_ < attrib_len) { info[_g.gCriteria_list[_loc2_][_loc1_]] = _g.gSchool_array[school_id][_g.gCriteria_list[_loc2_][_loc1_]]; _loc1_ = _loc1_ + 1; } _loc2_ = _loc2_ + 1; } return info; } function school_view(newid, pos) { trace("school_view - id is: " + newid); trace("gClipLevel: " + gClipLevel); var _loc3_ = school_get_id(id,pos); school_info.removeMovieClip(); print_template.removeMovieClip(); updateAfterEvent(); var _loc1_ = school_get_info(_loc3_); content._visible = false; var _loc2_ = undefined; if(_loc1_.school_type == "Independent Secondary") { if(_loc1_.category == "Enhanced") { if(_loc1_.sub_type == "Scottish independent secondary") { _loc2_ = "info_independent_secondary_profiled_scottish"; } else if(_loc1_.sub_type == "Scottish independent secondary (A-levels)") { _loc2_ = "info_independent_secondary_profiled_scottish_a_levels"; } else if(_loc1_.sub_type == "Independent secondary (small sixth form)") { _loc2_ = "info_independent_secondary_non_profiled_11_16"; } else { _loc2_ = "info_independent_secondary_profiled"; } } else if(_loc1_.category != "Enhanced") { if(_loc1_.sub_type == "Independent secondary (11-16)") { _loc2_ = "info_independent_secondary_non_profiled_11_16"; } else if(_loc1_.sub_type == "Scottish independent secondary") { _loc2_ = "info_independent_secondary_non_profiled_scottish"; } else if(_loc1_.sub_type == "Scottish independent secondary (A-levels)") { _loc2_ = "info_independent_secondary_non_profiled_scottish_a_levels"; } else if(_loc1_.sub_type == "Independent secondary (small sixth form)") { _loc2_ = "info_independent_secondary_non_profiled_11_16"; } else { _loc2_ = "info_independent_secondary_non_profiled"; } } } else if(_loc1_.school_type == "State Secondary") { if(_loc1_.category == "Enhanced") { if(_loc1_.sub_type == "State secondary (11-16)") { _loc2_ = "info_state_secondary_profiled_11_16"; } else if(_loc1_.sub_type == "Scottish state secondary") { _loc2_ = "info_state_secondary_profiled_scottish"; } else if(_loc1_.sub_type == "Sixth form college") { _loc2_ = "info_state_secondary_profiled_sixth_form"; } else { _loc2_ = "info_state_secondary_profiled"; } } else if(_loc1_.category != "Enhanced") { if(_loc1_.sub_type == "State secondary (11-16)") { _loc2_ = "info_state_secondary_non_profiled_11_16"; } else if(_loc1_.sub_type == "Scottish state secondary") { _loc2_ = "info_state_secondary_non_profiled_scottish"; } else if(_loc1_.sub_type == "Sixth form college") { _loc2_ = "info_state_secondary_non_profiled_sixth_form"; } else { _loc2_ = "info_state_secondary_non_profiled"; } } } else if(_loc1_.school_type == "Independent Preparatory and Junior") { if(_loc1_.category == "Enhanced") { if(_loc1_.sub_type == "Independent preparatory and junior (SATs)") { _loc2_ = "info_independent_preparatory_profiled_sat"; } else { _loc2_ = "info_independent_preparatory_profiled_non_sat"; } } else if(_loc1_.category != "Enhanced") { if(_loc1_.sub_type == "Independent preparatory and junior (SATs)") { _loc2_ = "info_independent_preparatory_non_profiled_sat"; } else { _loc2_ = "info_independent_preparatory_non_profiled_non_sat"; } } } else if(_loc1_.school_type == "State Primary") { if(_loc1_.category == "Enhanced") { if(_loc1_.sub_type == "Small state primary") { _loc2_ = "info_small_state_primary_profiled"; } else if(_loc1_.sub_type == "Northern Ireland state primary" || _loc1_.sub_type == "Welsh state primary" || _loc1_.sub_type == "Scottish state primary") { _loc2_ = "info_state_primary_scot_welsh_ni_profiled"; } else { _loc2_ = "info_state_primary_profiled"; } } else if(_loc1_.category != "Enhanced") { if(_loc1_.sub_type == "Small state primary") { _loc2_ = "info_small_state_primary_non_profiled"; } else { _loc2_ = "info_state_primary_non_profiled"; } } } attachMovie(_loc2_,"school_info",_g.gClipLevel++,{_x:15,_y:2045}); trace("mcTemplateID:" + _loc2_); school_info.printTemplateID = _loc2_.split("info_").join("print_"); gotoAndStop("school_info"); play(); _loc1_; } function info_tabs_init(tabID, col) { with(school_info) { var tabArray = new Array("b_info","b_profile","b_details"); var i = 0; while(i < tabArray.length) { var tab = tabArray[i].split("_")[1]; if(tab != tabID) { _parent._parent.colour_change(eval(tabArray[i]).bg,col); } else { var myColorTransform = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0}; _parent._parent.colour_change(eval(tabArray[i]).bg,myColorTransform); } i++; } b_info.onRelease = b_profile.onRelease = b_details.onRelease = function() { var tabArray = new Array("b_info","b_profile","b_details"); var tabID = this._name; var i = 0; while(i < tabArray.length) { trace("!!!!"); if(tabArray[i] != tabID) { _parent._parent.colour_change(eval(tabArray[i]).bg,col); } else { var myColorTransform = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0}; _parent._parent.colour_change(eval(tabID).bg,myColorTransform); } i++; } gotoAndPlay(this._name.split("_")[1]); }; } } function print_school(templateID) { trace("print using: " + templateID); attachMovie(templateID,"print_template",_g.gClipLevel++,{_x:250,_y:1500}); info_init(print_template); results_panel_init(print_template); print_int = setInterval(print_school_send_to_printer,500); } function print_school_send_to_printer() { clearInterval(print_int); getURL("printasbitmap:",print_template); } function setTablePage1ButtonHandlers() { var _loc1_ = this; b_indi_secondary.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_indi_secondary_11_16.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_indi_secondary_scottish_en.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_indi_secondary_scottish_sc.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_indi_prep.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_indi_prep_a_z.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_state_secondary.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_state_secondary_11_16.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_state_secondary_sixth.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_state_secondary_scotland.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_state_primary.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_state_primary_small.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_state_primary_scot.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_state_primary_welsh.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; b_state_primary_ni.onRelease = function() { referrer = "tables"; schools_search_preset(this._name); }; } _g = _global; _g.thisYear = String(_g.cdYearFull); _g.thisYearShort = String(_g.cdYearFull).substring(2,4); _g.lastYear = String(_g.cdYearFull - 1); _g.lastYearShort = String(_g.cdYearFull - 1).substring(2,4); _g.gKeyListener = new Object(); _g.gSchool_array = new Array(); if(!_g.gLastSearch) { _g.gLastSearch = new Object(); } _g.gActiveSearch = ""; _g.gLEA; _g.gRegion; _g.gRegionArray = new Array(["Please select..."]); _g.gRegionArray.push(["London","Corporation of London","Barking and Dagenham","Barnet","Bexley","Brent","Bromley","Camden","City of London","Croydon","Ealing","Enfield","Greenwich","Hackney","Hammersmith and Fulham","Haringey","Harrow","Havering","Hillingdon","Hounslow","Islington","Kensington and Chelsea","Kingston upon Thames","Lambeth","Lewisham","Merton","Newham","Redbridge","Richmond upon Thames","Southwark","Sutton","Tower Hamlets","Waltham Forest","Wandsworth","Westminster"]); _g.gRegionArray.push(["South East","Essex","Hertfordshire","Buckinghamshire","Milton Keynes","Oxfordshire","West Berkshire","West Sussex","East Sussex","Kent","Hampshire","Southampton","Portsmouth","Brighton and Hove","Isle of Wight","Reading","Wokingham","Bracknell Forest","Windsor and Maidenhead","Slough","Luton","Thurrock","Medway","Southend on Sea","Surrey"]); _g.gRegionArray.push(["South West","Guernsey","Jersey","Cornwall","Isles of Scilly","Torbay","Plymouth","Devon","Somerset","Bristol","South Gloucestershire","Bath and North East Somerset","North Somerset","Wiltshire","Swindon","Dorset","Poole","Bournemouth","Gloucestershire"]); _g.gRegionArray.push(["Midlands","Birmingham","Dudley","Walsall","Sandwell","Solihull","Coventry","Wolverhampton","Warwickshire","Northamptonshire","Leicestershire","Leicester","Nottinghamshire","Nottingham","Derbyshire","Derby","Staffordshire","Stoke-on-Trent","Shropshire","Telford and Wrekin","Worcestershire","Herefordshire"]); _g.gRegionArray.push(["North West","Isle of Man","Wigan","Lancashire","Cheshire","Wirral","Blackpool","Blackburn with Darwen","Rochdale","Bury","Bolton","Sefton","Liverpool","Knowsley","St Helens","Salford","Manchester","Oldham","Tameside","Trafford","Warrington","Halton","Stockport"]); _g.gRegionArray.push(["North","Northumberland","North Tyneside","Newcastle upon Tyne","Gateshead","South Tyneside","Sunderland","Durham","Cumbria","North Yorkshire","Middlesbrough","Stockton-on-Tees","Darlington","Redcar and Cleveland","Hartlepool","East Riding of Yorkshire","York","Leeds","Bradford","Wakefield","Calderdale","Kirklees","Barnsley","Doncaster","Rotherham","Sheffield","Kingston upon Hull"]); _g.gRegionArray.push(["Eastern","North Lincolnshire","North East Lincolnshire","Lincolnshire","Rutland","Peterborough","Cambridgeshire","Norfolk","Suffolk","Bedfordshire"]); _g.gRegionArray.push(["Scotland","Scotland"]); _g.gRegionArray.push(["Wales","Welsh","Wales","Isle of Angelsey","Gwynedd","Conwy","Denbighshire","Flintshire","Wrexham","Powys","Ceredigion","Carmarthenshire","Pembrokeshire","Swansea","Neath Port Talbot","Bridgend","Rhondda, Cynon, Taff","Vale of Glamorgan","Merthyr Tydfil","Caerphilly","Cardiff","Newport","Blaenau Gwent","Torfaen","Monmouthshire"]); _g.gRegionArray.push(["Northern Ireland","Belfast","Northern Ireland","Belfast library board","South Eastern library board","Southern library board","Western library board","North Eastern library board"]); _g.gLEAArray = new Array("Please select...","Barking and Dagenham","Barnet","Barnsley","Bath and North East Somerset","Bedfordshire","Bexley","Birmingham","Blackburn with Darwen","Blackpool","Bolton","Bournemouth","Bracknell Forest","Bradford","Brent","Brighton and Hove","Bristol","Bromley","Buckinghamshire","Bury","Calderdale","Cambridgeshire","Camden","Cheshire","City of London","Cornwall","Coventry","Croydon","Cumbria","Darlington","Derby","Derbyshire","Devon","Doncaster","Dorset","Dudley","Durham","Ealing","East Riding of Yorkshire","East Sussex","Enfield","Essex","Gateshead","Gloucestershire","Greenwich","Hackney","Halton","Hammersmith and Fulham","Hampshire","Haringey","Harrow","Hartlepool","Havering","Herefordshire","Hertfordshire","Hillingdon","Hounslow","Isle of Wight","Isles of Scilly","Islington","Kensington and Chelsea","Kent","Kingston upon Hull","Kingston-upon-Thames","Kirklees","Knowsley","Lambeth","Lancashire","Leeds","Leicester","Leicestershire","Lewisham","Lincolnshire","Liverpool","Luton","Manchester","Medway","Merton","Middlesbrough","Milton Keynes","Newcastle upon Tyne","Newham","Norfolk","North East Lincolnshire","North Lincolnshire","North Somerset","North Tyneside","North Yorkshire","Northamptonshire","Northumberland","Nottingham","Nottinghamshire","Oldham","Oxfordshire","Peterborough","Plymouth","Poole","Portsmouth","Reading","Redbridge","Redcar and Cleveland","Richmond-upon-Thames","Rochdale","Rotherham","Rutland","Salford","Sandwell","Sefton","Sheffield","Shropshire","Slough","Solihull","Somerset","South Gloucestershire","South Tyneside","Southampton","Southend on Sea","Southwark","St Helens","Staffordshire","Stockport","Stockton-on-Tees","Stoke-on-Trent","Suffolk","Sunderland","Surrey","Sutton","Swindon","Tameside","Telford and Wrekin","Thurrock","Torbay","Tower Hamlets","Trafford","Wakefield","Walsall","Waltham Forest","Wandsworth","Warrington","Warwickshire","West Berkshire","West Sussex","Westminster","Wigan","Wiltshire","Windsor and Maidenhead","Wirral","Wokingham","Wolverhampton","Worcestershire","York"); _g.gSchoolsOfTheYear = new Array("199172","IS249","212756","216949","199428","IS010"); oCurrentSearch = new Object(); setTablePage1ButtonHandlers(); if(map.getBytesLoaded() < 50) { map.loadMovie("map.swf"); } map_enable(); school_summary_remove(); if(_g.gNavActive == "shortlist") { Key.removeListener(_g.gKeyListener); content.gotoAndPlay("search_results_shortlist"); var search = new Object(); search.searchLimit = 100; var schools_in_shortlist = ""; if(_g.gShortlist.schools.length >= 1) { var i = 0; while(i < _g.gShortlist.schools.length) { schools_in_shortlist += "\'" + _g.gShortlist.schools[i] + "\'"; if(i < _g.gShortlist.schools.length - 1) { schools_in_shortlist += " OR school_id = "; } i++; } search.sql = "SELECT school_id,name,school_type,sub_type,st_ranking" + _g.thisYearShort + ",st_ranking" + _g.lastYearShort + ",town,entry_gender,posx,posy,unique_id FROM schools,results WHERE schools.school_id = results.school_id AND school_id = " + schools_in_shortlist + " ORDER BY st_ranking" + _g.thisYearShort + ",st_ranking" + _g.lastYearShort + " DESC"; schools_search(search); } else { Key.removeListener(_g.gKeyListener); if(search_int == undefined) { var id = new Object(); id.title = "You have no schools within your shortlist"; id.content = "To shortlist a school, click it\'s save icon"; _parent.help_view(id,clip); } } } else if(_g.gGlobalSearch) { schools_search(_g.gGlobalSearch); } _g.gSort_Ascending = 0;